
//增加attribute
function addAttribute(){
	var url = __ctxPath+"/customer/customerAttribute.html?decorator=windowPage&doAction=attributeDefine";
	openAttributeDefineDialog(url);
}
//增加attribute Callback
function addAttributeCallback(attribute){
	window.location.href = __ctxPath+"/customer/customerAttribute.html";
}
//编辑attribute 
function editAttribute(attributeId){
	var url = __ctxPath+"/customer/customerAttribute.html?decorator=windowPage&doAction=attributeDefine&attributeId="+attributeId;
	openAttributeDefineDialog(url);
}
//编辑attribute  Callback
function editAttributeCallback(attribute,quickSearchOption){
	window.location.href = __ctxPath+"/customer/customerAttribute.html";
}
//删除多个属性
function deleteAttributes(){

}
//打开属性定义dialog
function openAttributeDefineDialog(url){
	dlgattributeDefineDialog_show();
	$j('#attributeDefineIframe').get(0).src = url;
}
//关闭属性定义dialog
function closeAttributeDefineDialog(){
	dlgattributeDefineDialog_close();
	$j('#attributeDefineIframe').get(0).src = __ctxPath+"/loading.html?decorator=blank";
}


//提升属性顺序
//linkDOM 是一个超链接对象
function moveUpAttribute(linkDOM){
	var me = $j(linkDOM).parents("tr");
	var prev = me.prev("tr");
	prev.before(me);
	if(prev.length >0){
		var meClassName = me[0].className;
		var prevClassName = prev[0].className;
		prev.removeClass("odd").removeClass("even").addClass(meClassName);
		me.removeClass("odd").removeClass("even").addClass(prevClassName);
	}	
	updateSortOrders();
}

//降低属性顺序
//linkDOM 是一个超链接对象
function moveDownAttribute(linkDOM){
	var me = $j(linkDOM).parents("tr");
	var next = me.next("tr");
	next.after(me);
	if(next.length >0){
		var meClassName = me[0].className;
		var nextClassName = next[0].className;
		next.removeClass("odd").removeClass("even").addClass(meClassName);
		me.removeClass("odd").removeClass("even").addClass(nextClassName);
	}	
	updateSortOrders();
}
//提交属性顺序
function updateSortOrders(){
	
	var paraData=$j("#customerAttributeListForm :input[name='multiIds2']").serializeArray();
	if(paraData.length>0){
		$j.post(__ctxPath + "/customer/customerAttribute/blank.html?doAction=updateSortOrders", paraData);
	}
}
